<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //在一个笼子里,有鸡和免子共计30只,它们的脚总共有90条。请问笼子里有多少只鸡和免子?
        for (var x = 1; x <= 30; x++) {
            if (x * 2 + (30 - x) * 4 == 90) {
                console.log(x);
                y = 30 - x
                console.log(y);
            }
        }
    </script>
</body>

</html>